<!--
Variables set for this template:
  bowls:   List of bowls; see bowl.py for format
  players: List of (Player, {'bowl_id': 'team_id'}) for started bowl choices
  winners: Dict of finished bowl outcomes {'bowl_id': 'team_id'}
-->
<html>
  <head>
    <link type="text/css" rel="stylesheet" href="/static/scoreboard.css" />
  </head>
  <body>
    <h1>Scoreboard</h1>
    <table>
      <tr>
        <th></th>
        <th></th>
	{% for bowl in bowls %}
        <th title="{{ bowl[4] }}">{{ bowl[1] }}</th>
	{% endfor %}
      </tr>
      {% for p in players %}
      <tr>
	<th>{{ p[0].user.nickname() }}</th>
	<td>{{ '%5.3f' % (p[0].pct_correct or 0.0) }}</td>
	{% for bowl in bowls %}
        <td class="{{ ('right' if p[1][bowl[1]] == winners[bowl[1]] else 'wrong') if bowl[1] in p[1] and bowl[1] in winners }}">{{ p[1].get(bowl[1], '') }}</td>
	{% endfor %}
      </tr>
      {% endfor %}	
    </table>
  </body>
</html>
